1. Field of the Invention
This invention relates to an image processing method and apparatus that make possible volume representation, and particularly to an image processing method that implements the effects of fog or dust deployed in space, and such volume rendering as objects seen through a lens, and frosted glass, etc., by polygons, and to an image processing apparatus for embodying that method.
2. Description of the Related Art
When real scenery is observed carefully, as the scene becomes increasingly distant, terrain and structures therein sometimes appear to be hazy, blending together with the atmosphere. This effect is particularly pronounced in places like cities where smog and the like have been produced. When thick fog develops, moreover, even nearby scenery sometimes cannot be seen well. These effects are produced because light reflected from objects is blocked by such fine particles as dust and water vapor present in the air so that that light is attenuated by the time it reaches the observer. There are also times when street lights and search lights or the like at night describe the path of the light from the light source as they illuminate an object. That happens because the light source path can be seen by the eye as it is diffused and reflected by fine particles and the like in the air. The representation of such phenomena as these, because the condition of the space affects the scene, requires delineation for that space, that is, requires volume rendering.
In general, in real time three-dimensional computer graphics (3DCG) today, predominate use is made of surface rendering wherein planar models called polygons are delineated. With volume rendering, because of the necessity of delineating volume area interiors, in real time CG, the delineation of volumes in real time requires innovative measures. The following techniques have been proposed in the past.
(1) Ray Casting Method:
Delineated space is partitioned into very small cuboid unit spaces, as seen from the direction of the field of view, called voxels, and attributes such as volume density are calculated for each voxel. During delineation, lines of sight that are cast in the delineated space correspond to the voxels on the screen, and the sums resulting from the addition of density data for a volume existing in the voxels sampled are made pixel data.
(2) Marching Cubes Method:
As in the ray casting method, volume data are made density data for each voxel, and those densities are converted to a polygon mesh in line with established threshold values.
(3) Scene Fog Method:
This is a light beam attenuation representation method. For the objects delineated, a single color called the fog color is blended by finding mixture ratios by Z values from the view point.
With the conventional methods (1) and (2) described above, however, at the point in time when an object is divided into volumes, an enormous volume of data and an enormous volume of computations are required. There is a problem with these methods in that they cannot be applied to image processing wherewith the delineated regions are wide, and are continually changing, as in games or the like.
With the conventional method (3), moreover, in order for fog effects to be uniformly processed for an entire scene, it is not possible to represent places where the density varies from thick to thin, as in thick fog, or to represent fog in one or more portions of a scene, wherefore realism is compromised, which is a problem.
Accordingly, an object of the present invention is to provide an image processing method and apparatus for effecting volume representation in real time.
Another object of the present invention is to provide an image processing method and apparatus for making volume representation in necessary regions and enhancing image realism.
Yet another object of the present invention is to provide an image processing method and apparatus for simply implementing complex volume representation.
Yet another object of the present invention is to provide an image processing method and apparatus for processing a plurality of volumes at high speed.
Yet another object of the present invention is to provide an image processing method and apparatus for simply effecting volume representation such as fog or dust deployed in space or objects viewed through a lens or frosted glass and the like.
In order to attain the objects noted above, the present invention is an image processing method for generating image data, from pluralities of polygon data, for each pixel on a display screen, having a step for receiving volume polygons and delineation subject polygons for representing volumes and detecting depth differences between those volume polygons and those delineation subject polygons, a step for modulating the attributes of the volume polygons according to those depth differences, and a step for generating image data for each pixel from those modulated polygons and those delineation subject polygons. Because volume representation is done with polygons and the polygons are modulated with the depth differences, volume representation can be done by real time polygon delineation.
The modulation step noted above is able to effect volume representation using blend processing by comprising a step for modulating the depth differences detected to blend values using a conversion table.
Further, the modulation step noted above is able to effect volume representation using texture processing by comprising a step for modulating texture coordinates with the detected depth differences.
Further, the step for detecting depth differences noted above is able to effect partial volume representation by comprising a step for determining regions where the volume polygons and the delineation subject polygons overlap, and a step for detecting depth differences between the volume polygons and the delineation subject polygons in such overlapping regions.
Further, the determination step noted able is able to process a plurality of polygons by comprising a step for detecting regions where a plurality of volume polygons and the delineation subject polygons overlap.
Further, based on depth differences between light volume polygons existing between the delineation subject polygons and the view point, the transparency of the light volume polygons is altered, and the delineation subject polygons are subjected to blending processing according to light volume polygon color data and the altered transparency. As a result, such special effects as fog or dust deployed in space can be represented.
In another aspect of the present invention, texture coordinates for lens volume polygons are altered on the basis of depth differences between lens volume polygons existing between the delineation subject polygons and the view point, the texture data for the lens volume polygons are fetched according to the altered texture coordinates, and lens volume polygon delineation is performed. By so doing, special effects such as the effect of an object viewed through a lens can be represented.
In another aspect of the present invention, the level of detail of the texture data in the delineation subject polygons is altered on the basis of depth differences between delineation subject polygons and semitransparent polygons, and the delineation subject polygons are delineated according to texture data corresponding to the altered level of detail. In another aspect of the present invention, the transparency of semitransparent polygons is altered on the basis of depth differences between delineation subject polygons and semitransparent polygons, and the delineation subject polygons are subjected to blending processing according to color data for the semitransparent polygons and the altered transparency. By so doing, such special effects as a frosted glass effect can be represented, for example.